Left Termination of the query pattern f_in_3(g, a, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

f(0, Y, 0).
f(s(X), Y, Z) :- ','(f(X, Y, U), f(U, Y, Z)).

Queries:

f(g,a,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

f_in(s(X), Y, Z) → U1(X, Y, Z, f_in(X, Y, U))
f_in(0, Y, 0) → f_out(0, Y, 0)
U1(X, Y, Z, f_out(X, Y, U)) → U2(X, Y, Z, U, f_in(U, Y, Z))
U2(X, Y, Z, U, f_out(U, Y, Z)) → f_out(s(X), Y, Z)

The argument filtering Pi contains the following mapping:
f_in(x1, x2, x3)  =  f_in(x1)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
0  =  0
f_out(x1, x2, x3)  =  f_out(x3)
U2(x1, x2, x3, x4, x5)  =  U2(x5)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

f_in(s(X), Y, Z) → U1(X, Y, Z, f_in(X, Y, U))
f_in(0, Y, 0) → f_out(0, Y, 0)
U1(X, Y, Z, f_out(X, Y, U)) → U2(X, Y, Z, U, f_in(U, Y, Z))
U2(X, Y, Z, U, f_out(U, Y, Z)) → f_out(s(X), Y, Z)

The argument filtering Pi contains the following mapping:
f_in(x1, x2, x3)  =  f_in(x1)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
0  =  0
f_out(x1, x2, x3)  =  f_out(x3)
U2(x1, x2, x3, x4, x5)  =  U2(x5)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

F_IN(s(X), Y, Z) → U11(X, Y, Z, f_in(X, Y, U))
F_IN(s(X), Y, Z) → F_IN(X, Y, U)
U11(X, Y, Z, f_out(X, Y, U)) → U21(X, Y, Z, U, f_in(U, Y, Z))
U11(X, Y, Z, f_out(X, Y, U)) → F_IN(U, Y, Z)

The TRS R consists of the following rules:

f_in(s(X), Y, Z) → U1(X, Y, Z, f_in(X, Y, U))
f_in(0, Y, 0) → f_out(0, Y, 0)
U1(X, Y, Z, f_out(X, Y, U)) → U2(X, Y, Z, U, f_in(U, Y, Z))
U2(X, Y, Z, U, f_out(U, Y, Z)) → f_out(s(X), Y, Z)

The argument filtering Pi contains the following mapping:
f_in(x1, x2, x3)  =  f_in(x1)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
0  =  0
f_out(x1, x2, x3)  =  f_out(x3)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
F_IN(x1, x2, x3)  =  F_IN(x1)
U21(x1, x2, x3, x4, x5)  =  U21(x5)
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

F_IN(s(X), Y, Z) → U11(X, Y, Z, f_in(X, Y, U))
F_IN(s(X), Y, Z) → F_IN(X, Y, U)
U11(X, Y, Z, f_out(X, Y, U)) → U21(X, Y, Z, U, f_in(U, Y, Z))
U11(X, Y, Z, f_out(X, Y, U)) → F_IN(U, Y, Z)

The TRS R consists of the following rules:

f_in(s(X), Y, Z) → U1(X, Y, Z, f_in(X, Y, U))
f_in(0, Y, 0) → f_out(0, Y, 0)
U1(X, Y, Z, f_out(X, Y, U)) → U2(X, Y, Z, U, f_in(U, Y, Z))
U2(X, Y, Z, U, f_out(U, Y, Z)) → f_out(s(X), Y, Z)

The argument filtering Pi contains the following mapping:
f_in(x1, x2, x3)  =  f_in(x1)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
0  =  0
f_out(x1, x2, x3)  =  f_out(x3)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
F_IN(x1, x2, x3)  =  F_IN(x1)
U21(x1, x2, x3, x4, x5)  =  U21(x5)
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 1 SCC with 1 less node.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
PiDP
              ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

F_IN(s(X), Y, Z) → F_IN(X, Y, U)
U11(X, Y, Z, f_out(X, Y, U)) → F_IN(U, Y, Z)
F_IN(s(X), Y, Z) → U11(X, Y, Z, f_in(X, Y, U))

The TRS R consists of the following rules:

f_in(s(X), Y, Z) → U1(X, Y, Z, f_in(X, Y, U))
f_in(0, Y, 0) → f_out(0, Y, 0)
U1(X, Y, Z, f_out(X, Y, U)) → U2(X, Y, Z, U, f_in(U, Y, Z))
U2(X, Y, Z, U, f_out(U, Y, Z)) → f_out(s(X), Y, Z)

The argument filtering Pi contains the following mapping:
f_in(x1, x2, x3)  =  f_in(x1)
s(x1)  =  s(x1)
U1(x1, x2, x3, x4)  =  U1(x4)
0  =  0
f_out(x1, x2, x3)  =  f_out(x3)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
F_IN(x1, x2, x3)  =  F_IN(x1)
U11(x1, x2, x3, x4)  =  U11(x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ PiDP
              ↳ PiDPToQDPProof
QDP
                  ↳ UsableRulesReductionPairsProof

Q DP problem:
The TRS P consists of the following rules:

U11(f_out(U)) → F_IN(U)
F_IN(s(X)) → U11(f_in(X))
F_IN(s(X)) → F_IN(X)

The TRS R consists of the following rules:

f_in(s(X)) → U1(f_in(X))
f_in(0) → f_out(0)
U1(f_out(U)) → U2(f_in(U))
U2(f_out(Z)) → f_out(Z)

The set Q consists of the following terms:

f_in(x0)
U1(x0)
U2(x0)

We have to consider all (P,Q,R)-chains.
By using the usable rules with reduction pair processor [15] with a polynomial ordering [25], all dependency pairs and the corresponding usable rules [17] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

U11(f_out(U)) → F_IN(U)
F_IN(s(X)) → U11(f_in(X))
F_IN(s(X)) → F_IN(X)
The following rules are removed from R:

f_in(s(X)) → U1(f_in(X))
U2(f_out(Z)) → f_out(Z)
Used ordering: POLO with Polynomial interpretation [25]:

POL(0) = 0   
POL(F_IN(x1)) = x1   
POL(U1(x1)) = 2 + 2·x1   
POL(U11(x1)) = 1 + x1   
POL(U2(x1)) = 2 + 2·x1   
POL(f_in(x1)) = x1   
POL(f_out(x1)) = 2·x1   
POL(s(x1)) = 2 + 2·x1   



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ PiDP
              ↳ PiDPToQDPProof
                ↳ QDP
                  ↳ UsableRulesReductionPairsProof
QDP
                      ↳ PisEmptyProof

Q DP problem:
P is empty.
The TRS R consists of the following rules:

f_in(0) → f_out(0)
U1(f_out(U)) → U2(f_in(U))

The set Q consists of the following terms:

f_in(x0)
U1(x0)
U2(x0)

We have to consider all (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.